//
//  Setting.swift
//  TetrisGame
//
//  Created by mac on 2020/11/23.
//

import Foundation
import UIKit


////////////////////////////////////////////////////////////////////////////////
//MARK:  - 系统配置设置
////////////////////////////////////////////////////////////////////////////////
//包名
let K_APP_BUNDIE_IDENTIFIER = Bundle.main.infoDictionary?["CFBundleIdentifier"]

//App 版本
let K_APP_VERSION = String.init(format:"%@.%@",Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! CVarArg,Bundle.main.infoDictionary!["CFBundleVersion"] as! CVarArg)

//App name
let K_APP_NAME:String = NSLocalizedString("CFBundleDisplayName", tableName: "InfoPlist", bundle: Bundle.main, value: "", comment: "")

//AppId
let K_APP_ID = "000000"

/**
 * 视图背景色
 * https://www.jianshu.com/p/e6616e44cf60
 * iOS13-适配夜间模式/深色外观
 */
let K_APP_VIEWCONTROLLER_BACKGROUND_COLOR:UIColor = {
    return UIColor.init(red: 71.0/255.0, green: 71.0/255.0, blue: 72.0/255.0, alpha: 1)
}()

/** App主颜色 */
let K_APP_TINT_COLOR = UIColor.init(red: 71, green: 71, blue: 72, alpha: 1)

/** iPhoneX底部区域 */
let K_APP_IPHONX_BUTTOM = CGFloat.init(34)

/** iPhoneX顶部 导航 区域 */
let K_APP_IPHONX_TOP = CGFloat.init(44)

/** 安全区域 */
let K_APP_SAFETY_HEIGHT = UIDevice.current.isiPhoneX() ? K_APP_IPHONX_BUTTOM : 0.0
let K_APP_SAFETY_NAV_HEIGHT = UIDevice.current.isiPhoneX() ? K_APP_IPHONX_TOP : 20.0

/** 系统视图宽度 */
let K_APP_WIDTH = UIScreen.main.bounds.size.width

/** 系统视图高度 */
let K_APP_HEIGHT = UIScreen.main.bounds.size.height

//MARK: - 游戏设置
/** 方块尺寸大小 */
let BlockSize:CGFloat = 20.0
let TickLengthLevelOne = TimeInterval.init(600)

/** 总列数(根据设备自动计算) */
let NumColumns = Int(K_APP_WIDTH/BlockSize)
/** 总行数(根据设备自动计算) */
let NumRows = Int((K_APP_HEIGHT - CGFloat(UIDevice.current.isiPhoneX() ? 58 : 0) - 40)/BlockSize)

let StartingColumn = 4
let StartingRow = 0

let PreviewColumn = 12
let PreviewRow = 1

let PointsPerLine = 10
let LevelThreshold = 500
